package com.sojson.project.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.project.dao.MeanContentDao;
import com.sojson.project.entity.po.MeanContent;
import com.sojson.project.service.MeanContentService;

/**
 * 协议内容表Service实现类
 * 
 * @author liu
 * @date 2021-10-26
 */
@Service
public class MeanContentServiceImpl implements MeanContentService {

    @Resource
    private MeanContentDao meanContentDaoImpl;

    /**
     * 单条插入
     * 
     * @param dto
     * @return
     */
    @Override
    public int insert(MeanContent dto) {
        int insert = meanContentDaoImpl.insert(dto);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param dto
     * @return
     */
    @Override
    public int insertList(MeanContent dto) {
        int insertList = meanContentDaoImpl.insertList(dto.getMeanContents());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param dto
     * @return
     */
    @Override
    public int deleteByDto(MeanContent dto) {
        int deleteByDto = meanContentDaoImpl.deleteByDto(dto);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = meanContentDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<MeanContent> listAll() {
        List<MeanContent> findAll = meanContentDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param dto
     * @return
     */
    @Override
    public int countByDto(MeanContent dto) {
        int countByDto = meanContentDaoImpl.countByDto(dto);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param dto
     * @return
     */
    @Override
    public List<MeanContent> listByDto(MeanContent dto) {
        List<MeanContent> findByDto = meanContentDaoImpl.listByDto(dto);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = meanContentDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id数组删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        int deleteByIds = meanContentDaoImpl.deleteByIds(ids);
        return deleteByIds;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateAllById(MeanContent dto) {
        int updateAllById = meanContentDaoImpl.updateAllById(dto);
        return updateAllById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateAllByIdList(MeanContent dto) {
        int updateAllByIdList = meanContentDaoImpl.updateAllByIdList(dto);
        return updateAllByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateDtoListAllById(MeanContent dto) {
        int updateDtoListAllById = meanContentDaoImpl.updateDtoListAllById(dto.getMeanContents());
        return updateDtoListAllById;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateById(MeanContent dto) {
        int updateById = meanContentDaoImpl.updateById(dto);
        return updateById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateByIdList(MeanContent dto) {
        int updateByIdList = meanContentDaoImpl.updateByIdList(dto);
        return updateByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param dto
     * @return
     */
    @Override
    public int updateDtoListById(MeanContent dto) {
        int updateDtoListById = meanContentDaoImpl.updateDtoListById(dto.getMeanContents());
        return updateDtoListById;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public MeanContent findById(Integer id) {
        MeanContent findById = meanContentDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id数组查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<MeanContent> findByIds(Integer[] ids) {
        List<MeanContent> findByIds = meanContentDaoImpl.findByIds(ids);
        return findByIds;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param dto
     * @return
     */
    @Override
    public List<Integer> findIdByDto(MeanContent dto) {
        List<Integer> findIdByDto = meanContentDaoImpl.findIdByDto(dto);
        return findIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public int clear() {
        return meanContentDaoImpl.clear();
    }

}